/**
 * 
 */
package hawk.example.juni5.testkit;

import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;

import org.junit.jupiter.api.Test;

import org.junit.platform.testkit.engine.EngineTestKit;

/**
 * @author Hawk
 *
 */
public class EngineTestKitStatisticsDemo {

	@Test
	void verifyJupiterContainerStats() {
		EngineTestKit //
				.engine("junit-jupiter") // Select the JUnit Jupiter TestEngine.
				.selectors(selectClass(ExampleTestCase.class)) // Select the ExampleTestCase test class.
				.execute() // Execute the TestPlan
				.containerEvents() // Filter by container events.
				.assertStatistics(stats -> stats.started(2).succeeded(2)); // Assert statistics for test events.
	}

	@Test
	void verifyJupiterTestStats() {
		EngineTestKit//
				.engine("junit-jupiter") //
				.selectors(selectClass(ExampleTestCase.class)) //
				.execute() //
				.testEvents() // Filter by test events.
				.assertStatistics(stats -> stats.skipped(1).started(3).succeeded(1).aborted(1).failed(1));//
	}

}
